-
-
Notifications
You must be signed in to change notification settings - Fork 30.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gh-105658: fix excess trace events for except block ending with a conditional block #109384
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see a test here that reflects the case in the filed bug, where the line number actually jumps back to a previous line in a conditional. I believe that this change would fix that, but would it make sense to add an explicit test for it?
Misc/NEWS.d/next/Core and Builtins/2023-09-13-19-16-51.gh-issue-105658.z2nR2u.rst
Outdated
Show resolved
Hide resolved
Co-authored-by: Carl Meyer <[email protected]>
(3, 'line'), | ||
(3, 'exception'), | ||
(5, 'line'), | ||
(6, 'line'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On main we have here another
(5, 'line'),
Thanks @iritkatriel for the PR 🌮🎉.. I'm working now to backport this PR to: 3.12. |
Sorry, @iritkatriel, I could not cleanly backport this to |
|
|
… a conditional block (python#109384) (cherry picked from commit 4a54074)
|
|
GH-109411 is a backport of this pull request to the 3.12 branch. |
|
This will remove the event with the wrong line number. It will still work because RERAISE doesn't need to have a line number attached. In exception_unwind, the instruction pointer on the frame is used to determine which exception handler should be invoked. The location of the reraise doesn't show up in the traceback.
Fixes #105658.